<form class="form-horizontal" role="form" id="hostForm">
    <input type="hidden" name="id">
    <div class="form-group">
        <label  class="col-sm-3 control-label">基地名称</label>
        <div class="col-sm-9">
            <input type="text" class="form-control" name="hostName"/>
        </div>
    </div>
    <div class="form-group">
        <label  class="col-sm-3 control-label">基地编号</label>
        <div class="col-sm-9">
            <input type="text" class="form-control" name="hostSn"/>
        </div>
    </div>
    <div class="form-group" hide>
        <label  class="col-sm-3 control-label">管理员</label>
        <div class="col-sm-9">
            <select type="search" class="form-control select2" name="managerId"></select>
        </div>
    </div>
</form>

<script>
    $(function () {
        AsyncGet("${basePath}/manager/user/getUserRole",null,function (value) {
            if(value.data.role!="超级管理员"){
                $("#hostForm [hide]").hide();
            }
        })

        $("#hostForm [name='managerId']").loadSelect2(
            "${basePath}/root/function/getBackgroundManagerList",
            "请输入姓名查询", 2, "username", "username");
        var interval=setInterval(function () {
            if($("#hostForm .select2").length>0){
                $("#hostForm .select2").width("100%");
                clearInterval(interval);
            }
        },100);
    })
</script>

